where = output.find(eyecatcher)
if status == 0:
FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status )
-elif where > 1:
+elif where == -1:
FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output )
where = output.find(eyecatcher)
if status == 0:
FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status )
-elif where > 1:
+elif where == -1:
FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output )
try:
where = output.find(eyecatcher)
if status == 0:
FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status )
-elif where > 1:
+elif where == -1:
FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output )
try:
where = output.find(eyecatcher)
if status == 0:
FAIL("xm console returned invalid %i != 0" % status)
-elif where > 1:
+elif where == -1:
FAIL("xm console didn't report error on bad argument")
where = output.find(eyecatcher)
if status == 0:
FAIL("xm console returned invalid %i != 0" % status)
-elif where > 1:
+elif where == -1:
FAIL("xm console failed to report error on bad domid")
status, output = traceCommand("xm console NON_EXIST")
where = output.find(eyecatcher)
if status == 0:
FAIL("xm console returned invalid %i != 0" % status)
-elif where > 1:
+elif where == -1:
FAIL("xm console failed to report error on bad domname")
where = output.find(eyecatcher)
if status == 0:
FAIL("xm create returned invalid %i != 0" % status)
-elif where > 1:
+elif where == -1:
FAIL("xm create failed to report error on missing args")
status, output = traceCommand("xm create -x")
eyecatcher = "Error:"
where = output.find(eyecatcher)
-if where != 0:
+if where == -1:
FAIL("xm create failed to report error on bad arg")
eyecatcher = "NOROOT"
status, output = traceCommand("xm list")
where = output.find(eyecatcher)
-if where != -1 :
+if where != -1:
FAIL("xm create test05 passed with no root and no ramdisk. Expected result: Fail.")
where = output.find(eyecatcher)
if status == 0:
FAIL("xm destroy returned invalid %i != 0" % status)
-elif where > 1:
+elif where == -1:
FAIL("xm destroy failed to report error for missing arg")
where = output.find(eyecatcher)
if status == 0:
FAIL("xm destroy returned invalid %i != 0" % status)
-elif where > 1:
+elif where == -1:
FAIL("xm destroy failed to report error for bad arg")
where = output.find(eyecatcher)
if status == 0:
FAIL("xm destroy returned invalid %i != 0" % status)
-elif where > 1:
+elif where == -1:
FAIL("xm destroy failed to report error for bad domid")
where = output.find(eyecatcher)
if status == 0:
FAIL("xm dmesg returned invalid %i != 0" % status)
-elif where == 1:
+elif where == -1:
FAIL("xm dmesg failed to report error for bad arg")
status, output = traceCommand("xm help")
eyecatcher = "Usage:"
where = output.find(eyecatcher)
-if where != 0:
+if where == -1:
FAIL("xm help: didn't see the usage string")
status, output = traceCommand("xm")
eyecatcher = "Usage:"
where = output.find(eyecatcher)
-if where != 0:
+if where == -1:
FAIL("xm: didn't display usage when given no arguments")
status, output = traceCommand("xm -x")
eyecatcher = "Error:"
where = output.find(eyecatcher)
-if where != 0:
+if where == -1:
FAIL("xm failed to report error for bad arg")
status, output = traceCommand("xm help")
eyecatcher = "Usage:"
where = output.find(eyecatcher)
-if where != 0:
+if where == -1:
FAIL("xm help: didn't see the usage string")
where = output.find(eyecatcher)
if status == 0:
FAIL("xm list returned invalud %i != 0" % status)
-elif where > 1:
+elif where == -1:
FAIL("xm list failed to report error for bad arg")
where = output.find(eyecatcher)
if status == 0:
FAIL("xm list returned invalid %i != 0" % status)
-elif where > 1:
+elif where == -1:
FAIL("xm list failed to report error for invalid domid")
status, output = traceCommand("xm list")
eyecatcher = "Error: Most commands need root access"
where = output.find(eyecatcher)
-if where != 0:
+if where == -1:
FAIL("xm help: didn't see the root hint, saw %s" % output)
where = output.find(eyecatcher)
if status == 0:
FAIL("xm mem-set returned invalid %i == 0" % status)
-elif where > 1:
+elif where == -1:
FAIL("xm mem-set failed to report error for missing arg")
# destroy non existent parm input - negative test
where = output.find(eyecatcher)
if status == 0:
FAIL("xm mem-set returned invalid %i == 0" % status)
-elif where != 0:
+elif where == -1:
FAIL("xm mem-set failed to report error for bad arg")
# destroy non existent domain - negative test
where = output.find(eyecatcher)
if status == 0:
FAIL("xm mem-set returned invalid %i == 0" % status)
-elif where != 0:
+elif where == -1:
FAIL("xm mem-set failed to report error for invalid domid")
# destroy non existent domain and memory - negative test
status, output = traceCommand("xm mem-set 6666 64")
where = output.find(eyecatcher)
if status == 0:
- FAIL("xm mem-set returned invalid %i != 0" % status)
-elif where != 0:
+ FAIL("xm mem-set returned invalid %i == -1" % status)
+elif where == -1:
FAIL("xm mem-set failed to report error for invalid domid")
if status == 0:
domain.destroy()
FAIL("xm pause returned bad status, expected non 0, status is: %i" % status )
-elif where > 1:
+elif where == -1:
domain.destroy()
FAIL("xm pause returned bad output, expected Error, output is: %s" % output )
where = output.find(eyecatcher)
if status == 0:
FAIL("xm pause returned bad status, expected non 0, status is: %i" % status )
-elif where > 1:
+elif where == -1:
FAIL("xm pause returned bad output, expected Error, output is: %s" % output )
where = output.find(eyecatcher)
if status == 0:
FAIL("xm pause returned bad status, expected non 0, status is: %i" % status )
-elif where > 1:
+elif where == -1:
FAIL("xm pause returned bad output, expected Error, output is: %s" % output )
if status == 0:
domain.destroy()
FAIL("xm reboot returned invalid %i == 0" % status )
-elif where > 1:
+elif where == -1:
domain.destroy()
FAIL("xm reboot failed to report error for bad arg")
where = output.find(eyecatcher)
if status == 0:
FAIL("xm reboot returned invalid %i == 0" % status )
-elif where > 1:
+elif where == -1:
FAIL("xm reboot failed to report error for non-existent domain" )
FAIL("xm restore returned bad status, expected non 0, status is: %i" % status)
elif where2 == 0:
FAIL("xm restore returned a stack dump, expected nice error message")
-elif where1 > 0:
+elif where1 == -1:
FAIL("xm restore returned bad output, expected Error:, output is: %s" % output)
FAIL("xm restore returned bad status, expected non 0, status is: %i" % status)
elif where2 == 0:
FAIL("xm restore returned a stack dump, expected nice error message")
-elif where1 > 0:
+elif where1 == -1:
FAIL("xm restore returned bad output, expected Error:, output is: %s" % output)
FAIL("xm save returned bad status, expected non 0, status is: %i" % status)
elif where2 == 0:
FAIL("xm save returned a stack dump, expected nice error message")
-elif where1 > 0:
+elif where1 == -1:
FAIL("xm save returned bad output, expected Error:, output is: %s" % output)
FAIL("xm save returned bad status, expected non 0, status is: %i" % status)
elif where1 == 0:
FAIL("xm save returned a stack dump, expected nice error message")
-elif where2 > 0:
+elif where2 == -1:
FAIL("xm save returned bad output, expected Error:, output is: %s" % output)
where = output.find(eyecatcher)
if (ret == 0):
FAIL("xm shutdown returned invalid %i == 0" % ret)
-elif where != 0:
+elif where == -1:
FAIL("xm shutdown failed to report error for bad arg")
# Stop the domain (nice shutdown)
where = output.find(eyecatcher)
if (ret == 0):
FAIL("xm shutdown returned invalid %i == 0" % ret)
-elif where != 0:
+elif where == -1:
FAIL("xm shutdown failed to report error for bad domid")